#include "thread.h"
#include "../window/loginwindow.h"

clientThread::clientThread(QObject *parent)
    :QThread(parent){

}

void clientThread::clientRun(int mode){

    switch(mode){
    case CLIENT_EXIT:
        client->client_exit(param);
        emit SignalString(0);
        break;
    case CLIENT_CLOSE:
        //client->client_close(param);
        break;
    case CLIENT_LOGIN:
        emit SignalLogin(client->client_login(param));
        //释放登录变量（string）
        delete param;
        break;
    default:
        break;
    }

    emit endthread();
}
void clientThread::run(){
    clientRun(mode);
}
